import org.apache.catalina.startup.Tomcat;

public class TomcatMain {

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		final String CATALINA_HOME = "D:\\hubo\\project\\test-webapp\\src\\main\\webapp";
		Tomcat tomcat = new Tomcat();
		tomcat.setBaseDir(CATALINA_HOME);
		tomcat.setPort(8888);
		tomcat.addWebapp("", CATALINA_HOME);
		tomcat.start();
		System.out.println("Started tomcat");
		tomcat.getServer().await(); // Keeps Tomcat running until it is shut
									// down
		
	}
}
